<script lang="ts" setup>
import {ref, onUpdated, onBeforeMount, onBeforeUnmount, onUnmounted, onMounted} from 'vue'

onUpdated(() => {
  console.log("onUpdated")
})

onBeforeUnmount(() => {
  console.log("onBeforeUnmount")
})

onUnmounted(() => {
  console.log("onUnmounted")
  clearInterval(tt)
})
onBeforeMount(() => {
  console.log("onBeforeMount")
})

onMounted(() => {
  console.log("onMounted")
  tt = setInterval(() => {
    ts.value = new Date().toLocaleTimeString()
  }, 1000)
})

const ts = ref(new Date().toLocaleTimeString())
let tt: any


const count = ref(10)
</script>
<template>
  <h1>{{ ts }}</h1>
  <button @click="count++">{{ count }}</button>
</template>
